home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 February: Tool Chest / Dev.CD Feb 94.toast / New System Software Extensions / QuickDraw™ GX v1.0ß2 / Interfaces & Libraries / interfaces / font library.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-07-29  |  2.6 KB  |  86 lines  |  [TEXT/MPS ]

  1. /* graphics:  
  2.   gxFont library interfaces
  3.   by Cary Clark, Georgiann Delaney, Michael Fairman, Dave Good, Robert Johnson, Keith McGreggor, Mike Reed, Oliver Steele, David Van Brink, Chris Yerga
  4.   Copyright ©1987 - 1991 Apple Computer, Inc.  All rights reserved.
  5. */
  6.  
  7. #ifndef fontLibraryIncludes
  8. #define fontLibraryIncludes
  9.  
  10. #ifndef fontTypesIncludes
  11.   #include "font types.h"
  12. #endif
  13.  
  14. #ifndef graphicsTypesIncludes
  15.   #include "graphics types.h"
  16. #endif
  17.  
  18. #ifndef fontRoutinesIncludes
  19.   #include "font routines.h"
  20. #endif
  21.  
  22.  
  23. /*  example gxFont descriptor tags
  24. */
  25. #define weightVariationTag    0x77676874  /* 'wght' */
  26. #define widthVariationTag     0x77647468  /* 'wdth' */
  27. #define slantVariationTag     0x736c6e74  /* 'slnt' */
  28. #define opticalScaleVariationTag  0x6f70737a  /* 'opsz' */
  29.  
  30. /* weights for gxStyle matching */
  31. /* these will have to be tweaked*/
  32. /* this info could be in the gxFont???*/
  33. #define prefwghtweighting 0x00010000
  34. #define prefwdthweighting 0x00020000
  35. #define prefslntweighting 0x00010000/*this is naturally weighted to last place*/
  36. #define prefcontweighting 0x00040000
  37.  
  38. typedef enum commonFontEnums {
  39.   firstCommonFont,
  40.   chicagoFont = firstCommonFont,
  41.   courierFont,
  42.   genevaFont,
  43.   helveticaFont,
  44.   monacoFont,
  45.   newyorkFont,
  46.   symbolFont,
  47.   timesFont,
  48.   lastCommonFont = timesFont
  49. } commonFontEnums;
  50.  
  51.  
  52. enum{noMatching = 0,
  53.   useStyleMatching,
  54.   useVariationsMatching,
  55.   useTextFaceMatching= 4
  56.   };
  57.  
  58. typedef long commonFontEnum;
  59.  
  60. gxFont GetCommonFont(commonFontEnum);
  61. void SetShapeCommonFont(gxShape, commonFontEnum);
  62. void SetStyleCommonFont(gxStyle, commonFontEnum);
  63.  
  64. gxFont FindCNameFont(gxFontName meaning, const char name[]);
  65. gxFont FindPNameFont(gxFontName meaning, const unsigned char name[]);
  66.  
  67. long FindFontCName(gxFont fontID, gxFontName meaning, char name[]);
  68. long FindFontPName(gxFont fontID, gxFontName meaning, unsigned char name[]);
  69.  
  70. long FindStyleFontCName(gxStyle s, gxFontName meaning, char name[]);
  71. long FindStyleFontPName(gxStyle s, gxFontName meaning, unsigned char name[]);
  72. void SetStylePNamedFont(gxStyle s, const unsigned char name[]);
  73. void SetStyleCNamedFont(gxStyle s, const char* name);
  74.  
  75. long CountFontFamilies(void);
  76. gxFont FindFontFamily(long index, gxFontPlatform platform, gxFontScript script, gxFontLanguage language,
  77.   long nameLength, const unsigned char *name);
  78. long CountFontStyles(gxFont family);
  79. gxFont FindFontStyle(gxFont family, long index, gxFontPlatform platform, gxFontScript script, gxFontLanguage language,
  80.   long nameLength, const unsigned char *name);
  81.  
  82. void SetMatchingStyle(gxFont targetFamily, gxStyle theStyle, long matchInfo);
  83. gxStyle ReturnMatchingStyle(gxFont targetFamily, gxStyle theStyle, long matchInfo);
  84.  
  85. #endif
  86.